home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qgmanager.h.z / qgmanager.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.5 KB  |  99 lines

  1. /****************************************************************************
  2. ** $Id: qgmanager.h,v 2.14 1998/07/03 00:09:34 hanord Exp $
  3. **
  4. ** Definition of QGManager class (workhorse for QLayout classes)
  5. **
  6. ** Created : 960406
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QGMANAGER_H
  25. #define QGMANAGER_H
  26.  
  27. #ifndef QT_H
  28. #include "qintdict.h"
  29. #include "qwidget.h"
  30. #endif // QT_H
  31.  
  32.  
  33. class QChain;
  34. struct QGManagerData;
  35.  
  36. class QGManager : public QObject
  37. {
  38.     Q_OBJECT
  39. public:
  40.     QGManager( QWidget *parent, const char *name=0 );
  41.     ~QGManager();
  42.  
  43.     void setBorder( int b ) { border = b; }
  44.  
  45.     enum Direction { LeftToRight, RightToLeft, Down, Up };
  46.     enum { unlimited = QCOORD_MAX };
  47.  
  48.     QChain *newSerChain( Direction );
  49.     //    QChain *newSerChain( Direction, int );
  50.     QChain *newParChain( Direction );
  51.  
  52.     bool add( QChain *destination, QChain *source, int stretch = 0 );
  53.     bool addWidget( QChain *, QWidget *, int stretch = 0 );
  54.     bool addSpacing( QChain *, int minSize, int stretch = 0, int maxSize = unlimited );
  55.  
  56.     bool addBranch( QChain *destination, QChain *branch, int fromIndex,
  57.             int toIndex );
  58.     void setStretch( QChain*, int );
  59.     bool activate();
  60.  
  61.     void freeze( int w = 0, int h = 0 );
  62.     void unFreeze();
  63.  
  64.     QChain *xChain() {    return xC; }
  65.     QChain *yChain() {    return yC; }
  66.  
  67.     void  setMenuBar( QWidget *w ) { menuBar = w; }
  68.  
  69.     QWidget *mainWidget() { return main; }
  70.  
  71.     void remove( QWidget *w );
  72.  
  73.     void setName( QChain *, const char * );
  74.         
  75. protected:
  76.     bool  eventFilter( QObject *, QEvent * );
  77.  
  78. private:
  79.     int border;
  80.  
  81.     void      resizeHandle( QWidget *, const QSize & );
  82.     void      resizeAll();
  83.  
  84.     QChain *xC;
  85.     QChain *yC;
  86.     QWidget *main;
  87.     QWidget *menuBar;
  88.     int        menuBarHeight;
  89.     QGManagerData *extraData;
  90.     bool frozen;
  91.  
  92. private:    // Disabled copy constructor and operator=
  93.     QGManager( const QGManager & );
  94.     QGManager &operator=( const QGManager & );
  95. };
  96.  
  97.  
  98. #endif // QGMANAGER_H
  99.